<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
            list-style: none;
        }
        .layout {
            width: 720px;
            height: 350px;
            margin: 200px auto;
            position: relative;

        }
        ul {
            width: 100%;
            height: 100%;
            /*transform: rotate3d(1,1,0,-30deg);*/
            transform-style: preserve-3d;
        }
        li{
            float: left;
            width: 25%;
            height: 100%;
            position: relative;
            transform-style: preserve-3d;
            transition: transform 0.5s;
        }
        li>span {
            width: 100%;
            height: 100%;
            position: absolute;
            left: 0;
            top: 0;
        }
        li>span:nth-of-type(1){
            transform: translateZ(175px);
            background: url(images/l1.jpg);
        }
        li>span:nth-of-type(2){
            transform: translateY(-175px) rotateX(90deg);
            background: url(images/l2.jpg);
        }
        li>span:nth-of-type(3){
            transform: translateZ(-175px) rotateX(180deg);
            background: url(images/l3.jpg);
        }
        li>span:nth-of-type(4){
            transform: translateY(175px) rotateX(-90deg);
            background: url(images/l4.jpg);
        }
        /* 图片位置 */
        li:nth-of-type(2)>span {
            background-position: -100% 0;
        }
        li:nth-of-type(3)>span {
            background-position: -200% 0;
        }
        li:nth-of-type(4)>span {
            background-position: -300% 0;
        }
        /* 左右箭头 */
        .arrow {
            position: absolute;
            top: 50%;
            transform: translate(0,-50%);
            text-decoration: none;
            color: #fff;
            font-size: 30px;
            font-family: '宋体';
            padding: 20px;
            background-color: rgba(0, 0, 0, 0.5);
        }
        .arrPre { left: 0; }
        .arrNext { right: 0; }
    </style>
</head>
<body>
    <div class="layout">
        <ul>
            <li>
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </li>
            <li>
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </li>
            <li>
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </li>
            <li>
                <span></span>
                <span></span>
                <span></span>
                <span></span>
            </li>
        </ul>
        <a class="arrow arrPre" href="#">&lt;</a>
        <a class="arrow arrNext" href="#">&gt;</a>
    </div>

<script src="jquery-1.12.2.min.js"></script>
<script>
    $(function(){
        /* 定义图片索引 */
        var index = 0;
        /* 添加节流阀 */
        var flag = true;
        /* 下一张 */
        $('.arrNext').on('click',function(){
            if(flag) {
                index--;
                flag = false;
                $('li').each(function(k,e){
                    $(this).css({
                        'transform' : 'rotateX('+index*90+'deg)',
                        'transition-delay' : +k*0.2+'s'
                    });
                });
                setTimeout(function(){
                    flag = true;
                },1000);
            }
        });
        /* 上一张 */
        $('.arrPre').on('click',function(){
            if(flag) {
                index++;
                flag = false;
                $('li').each(function(k,e){
                    $(this).css({
                        'transform' : 'rotateX('+index*90+'deg)',
                        'transition-delay' : +k*0.2+'s'
                    });
                });
                setTimeout(function(){
                    flag = true;
                },1000);
            }
        });
    })
</script>




</body>
</html>